package com.flw.eslab.dto;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import com.flw.eslab.model.Project;
import com.flw.eslab.model.User;

public class Project_Dto {
	private Integer id;
	private String name; 
	private String content;
	private String keytech;
	private String url;
	private String state;
	private int year;
	private int month;
	private int day;
	private Date time;
	private String type;
	
	private Integer[] userIds;

	
	/*-------------------------------------------*/
	public Project toProject(){
		Project project =new Project();
		project.setContent(content);
		Date date=new Date(year,month,day);
		project.setDate(date);
		project.setId(id);
		project.setKeytech(keytech);
		project.setName(name);
		project.setState(state);
		project.setType(type);
		project.setUrl(url);
		Set<User> users=new HashSet<User>();
		for(Integer id :userIds){
			User user=new User();
			user.setId(id);
			users.add(user);
		}
		project.setUsers(users);
		return project;
		
	}
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	public int getYear() {
		return year;
	}
	public void setYear(int year) {
		this.year = year;
	}
	public int getMonth() {
		return month;
	}
	public void setMonth(int month) {
		this.month = month;
	}
	public int getDay() {
		return day;
	}
	public void setDay(int day) {
		this.day = day;
	}
	public Integer[] getUserIds() {
		return userIds;
	}
	public void setUserIds(Integer[] userIds) {
		this.userIds = userIds;
	}
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getKeytech() {
		return keytech;
	}

	public void setKeytech(String keytech) {
		this.keytech = keytech;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}





}
